package com.example.demo.config;

import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSONObject;

import java.util.HashMap;
import java.util.Map;

public class EishayParse {
    public static void main(String[] args) {
        String str = "{\n" +
                "    \"directoryId\": 98,\n" +
                "    \"metricsStatus\": \"laborum ex\",\n" +
                "    \"measureId\": 4,\n" +
                "    \"metricsName\": \"律党克\",\n" +
                "    \"director\": \"laboris eiusmod quis Ut\",\n" +
                "    \"datasourceId\": 72,\n" +
                "    \"orderByColumn\": \"id exercitation labore\",\n" +
                "    \"businessScope\": \"adipisicing commodo reprehenderit anim ullamco\",\n" +
                "    \"metricsTypeId\": 76,\n" +
                "    \"metricsId\": 68,\n" +
                "    \"columnName\": \"火计斯声实\",\n" +
                "    \"pageNum\": 39,\n" +
                "    \"pageSize\": 86,\n" +
                "    \"catalogDatabaseId\": 19,\n" +
                "    \"quotaId\": 37,\n" +
                "    \"factTableAlias\": \"Excepteur\",\n" +
                "    \"metricsCode\": \"71\",\n" +
                "    \"searchValue\": \"ut irure dolore eu qui\",\n" +
                "    \"remark\": \"in\",\n" +
                "    \"isAsc\": \"anim ea culpa ex non\",\n" +
                "    \"saveOrPublish\": \"aliquip veniam non voluptate\",\n" +
                "    \"publishStatus\": 83,\n" +
                "    \"columnAlias\": \"ullamco quis\",\n" +
                "    \"databaseSchema\": \"id est non\",\n" +
                "    \"isDefine\": 35,\n" +
                "    \"defineJson\": \"dolore mollit aliqua\",\n" +
                "    \"factTableName\": \"感积然\",\n" +
                "    \"orderBy\": \"Duis veniam amet cillum ex\",\n" +
                "    \"projectId\": 71\n" +
                "}";
        long start1 = System.currentTimeMillis();
        for (int i = 0; i < 100000; i++) {
            Map<String, Object> map = JSONObject.parseObject(str, HashMap.class);// .parseObj(str);
        }
        long dd1 = System.currentTimeMillis()-start1;
        System.out.println(dd1);
        long start = System.currentTimeMillis();
        for (int i = 0; i < 100000; i++) {
            Map<String, Object> map = JSONUtil.parseObj(str);
        }
        long dd = System.currentTimeMillis()-start;
        System.out.println(dd);

    }


}
